import re
import time
import requests
import uuid

url_page = "https://mm.enterdesk.com/dongmanmeinv/"
ret = requests.get(url=url_page)    # ret是html的响应对象
# print(ret.text)              # ret.text是html的字符串形式

url_lst= re.findall(r'https://up.enterdesk.com/edpic_360_360.*?\.jpg',ret.text)

# 1.发送请求
for url in url_lst:
    res = requests.get(url=url)
    time.sleep(3)
#     2.将响应数据转化为二进制流数据
    content = res.content
#     3. 将二进制流数据写入文件
    name = str(uuid.uuid1()) + ".jpg"
    with open(name,'wb') as f:
        print("正在下载%s" % name)
        f.write(content)
